package chabernac.android.chargemybattery.actions;

import android.app.Activity;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import chabernac.android.chargemybattery.R;
import chabernac.android.chargemybattery.battery.PowerSaveActionService;

public class ActionsActivity extends Activity {

    @Override
    protected void onCreate( Bundle savedInstanceState ) {
        super.onCreate( savedInstanceState );
        setContentView( R.layout.activity_action_priority );

        Intent bootintent = new Intent( this, PowerSaveActionService.class );
        PendingIntent pi = PendingIntent.getService( this, 0, bootintent, PendingIntent.FLAG_UPDATE_CURRENT );

        AlarmManager FPAlarm = (AlarmManager) getSystemService( Context.ALARM_SERVICE );
        FPAlarm.setRepeating( AlarmManager.RTC, System.currentTimeMillis() + 1 * 1000, 5 * 1000, pi );

    }

    @Override
    public boolean onCreateOptionsMenu( Menu menu ) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate( R.menu.action_priority, menu );
        return true;
    }

}
